package com.foodplus.www.presenter;

import com.foodplus.www.api.BaseSubscriber;
import com.foodplus.www.api.ExceptionHandle;
import com.foodplus.www.bean.special.SpecialBean;
import com.foodplus.www.model.impl.SpecialModelImpl;
import com.foodplus.www.view.impl.SpecialView;

import java.util.Map;

/**
 * Created by WangZhiChao on 2016/10/31.
 */

public class SpecialPresenter {
    SpecialView view;

    public SpecialPresenter(SpecialView view) {
        this.view = view;
    }

    public void getSpecialData(Map<String, String> params) {

        new SpecialModelImpl().getSpecialData(new BaseSubscriber<SpecialBean>() {
            @Override
            public void onSuccess(SpecialBean specialBean) {
                view.onSuccess(specialBean);
            }

            @Override
            public void onFail(ExceptionHandle.ResponeThrowable e) {
                view.onFail(e);
            }

            @Override
            public void onFinished() {
                view.onFinish();
            }
        }, params);

    }
}
